package com.springweb.simpleform;

import java.util.Date;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Past;
import javax.validation.constraints.Size;

import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.multipart.MultipartFile;

public class EmployeeDetails {

	private String firstName;
	private String lastName;
	private int age;
	private Date dob;
	private String email;
	private MultipartFile image;

	 @NotEmpty
	public String getFirstName() {
		return firstName;
	}
	 
	@Size(min=3,max=20)
    @NotBlank(message="Last name should not be empty")
	public String getLastName() {
		return lastName;
	}

	public int getAge() {
		return age;
	}

	@DateTimeFormat(pattern="dd/mm/yyyy")
	@NotNull
	@Past
	//always you have to use over getter method not setter. 
	public Date getDob() {
		return dob;
	}
    
    @NotBlank
	public String getEmail() {
		return email;
	}
	
    public MultipartFile getImage() {
		return image;
	}
    
    public void setImage(MultipartFile image) {
		this.image = image;
	}
    
    
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public void setAge(int age) {
		this.age = age;
	}

	 public void setEmail(String email) {
		this.email = email;
	}
	 
	public void setDob(Date dob) {
		this.dob = dob;
	}

	@Override
	public String toString() {
		return "EmployeeDetails [firstName=" + firstName + ", lastName="
				+ lastName + ", age=" + age + ", dob=" + dob + "]";
	}

	 
	
	
}
